﻿@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase
@using System.Linq
@using Nancy.Security

<!DOCTYPE html>
<html>
<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    <title>@ViewBag.Title</title>   
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
</head>

<body>
<div class="container-fluid">
<h4>Nancy Demo User Manager</h4>
   
    <div class="row">
        <div class="col-sm-7 col-md-9 col-lg-9">
        </div>
        <div class="col-sm-5 col-md-3 col-lg-3">
            <div class="">
                @if (Html.RenderContext.Context.CurrentUser.IsAuthenticated())
                {
                    <p><small><span style="padding-right:15px"><em>@Html.RenderContext.Context.CurrentUser.UserName</em></span>
                        <a href="@Url.Content("~/logout")">Logout</a></small></p>
                }
                else
                {
                    <p><small><a href="@Url.Content("~/login")">Login</a></small></p>
                }
            </div>
        </div>
        </div>
<div class="row">
    <div class="col-sm-2 col-md-2 col-lg-2">
         @if (Html.RenderContext.Context.CurrentUser.IsAuthenticated())
         {
            if (Html.RenderContext.Context.CurrentUser.Claims.Contains("Admin"))
            {
                @Html.Partial("Views/Partials/_AdminMenu")
            }
            else if (Html.RenderContext.Context.CurrentUser.Claims.Contains("Editor"))
            {
                @Html.Partial("Views/Partials/_EditorMenu")
            }
             else if (Html.RenderContext.Context.CurrentUser.Claims.Contains("Viewer"))
            {
                @Html.Partial("Views/Partials/_ViewerMenu")
            }
             else
             {
                @Html.Partial("Views/Partials/_PublicMenu")
             }
         }
         else
         {
             @Html.Partial("Views/Partials/_PublicMenu")
         }
        
    </div>
    <div class="col-sm-10 col-md-10 col-lg-10">
        <p>@RenderBody()</p>    
    </div>
          </div>
        </div>
  </body>
</html>
